package org.infodavid.common.services;

import org.infodavid.common.services.exceptions.ServiceException;

/**
 * The Interface IPasswordPolicy.
 */
public interface IPasswordPolicy {
	/** The Constant PASSWORD_CHARACTERS. */
	String PASSWORD_CHARACTERS =
	    "!/*_-=(){}[]?#%@|ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";

	/** The Constant PASSWORD_MIN_LENGTH. */
	byte PASSWORD_MIN_LENGTH = 5;

	/** The Constant PASSWORD_MAX_LENGTH. */
	byte PASSWORD_MAX_LENGTH = 32;

	/**
	 * Validate.
	 * @param userkey the user key
	 * @param password the password
	 * @throws ServiceException the service exception
	 */
	void validate(long userkey, String password) throws ServiceException;

	/**
	 * Generate password.
	 * @return the string
	 * @throws ServiceException the service exception
	 */
	String generatePassword() throws ServiceException;

	/**
	 * Encrypt password.
	 * @param value the value
	 * @return the string
	 * @throws ServiceException the service exception
	 */
	String encryptPassword(String value) throws ServiceException;
}
